Python PIP 使用国内镜像 |
您所在的位置:网站首页 › python pip镜像站 › Python PIP 使用国内镜像 |
Python PIP 使用国内镜像
文章目录
Python PIP 使用国内镜像1.临时变更2. 永久变更3.镜像地址
由于直接使用 pip 安装第三方包时,默认是从国外的路径进行下载的,下载速度比较慢,为了解决这个问题,我们需要把下载路径更换为国内镜像;
1.临时变更
在使用pip安装第三方包时,增加参数:-i https://pypi.tuna.tsinghua.edu.cn/simple(这是清华镜像) 举例: pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pandas 2. 永久变更windows系统:在user目录中创建一个pip目录,在目录中新建文件pip.ini,写入以下内容: [global] index-url=https://pypi.tuna.tsinghua.edu.cn/simple [install] trusted-host=mirrors.aliyun.comLinux系统:修改 ~/.pip/pip.conf 的内容为: [global] index-url=https://pypi.tuna.tsinghua.edu.cn/simple [install] trusted-host=mirrors.aliyun.com没有的话,就创建一个文件夹及文件,文件夹要加点,表示是隐藏文件夹。 3.镜像地址上述变更中,镜像地址可以更改为以下任意地址: 清华:https://pypi.tuna.tsinghua.edu.cn/simple/阿里云:https://mirrors.aliyun.com/pypi/simple/中国科技大学: https://pypi.mirrors.ustc.edu.cn/simple/华中理工大学:https://pypi.hustunique.com/山东理工大学:https://pypi.sdutlinux.org/豆瓣:https://pypi.douban.com/simple/ |
今日新闻 |
点击排行 |
|
推荐新闻 |
图片新闻 |
|
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭 |